package thread;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/*
public class CallableDemo1 implements Callable {
    public static void main(String[] args) throws ExecutionException, InterruptedException  {

        MyThread1 m1 = new MyThread1();
        FutureTask task = new FutureTask(new Callable() {
            @Override
            public Object call() throws Exception {

                int sum = 0;
                for (int i = 0; i <= 100; i++) {
                    sum = sum + i;
                }
                return sum;
            }
        });
        Thread thread = new Thread(task);
        thread.start();

    }
}*/
